package edu.avans.hartigehap.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Transient;

import org.joda.time.DateTime;

@Entity
public class ActualWebCustomer extends WebCustomer implements Serializable {
	private static final long serialVersionUID = 1L;

	private String username;
	private String password;
	private String firstName;
	private String lastName;
	private Date birthDate;
	private String address;
	private String phoneNumber;
	private String emailaddress;
	private boolean loggedIn;
	

	public ActualWebCustomer() {

	}
	
	//no account
	public ActualWebCustomer(String username, String password, String address, String phoneNumber, String emailaddress) {
		this.username = username;
		this.password = password;
		this.address = address;
		this.phoneNumber = phoneNumber;
		this.emailaddress = emailaddress;
	}

	//create account 
	public ActualWebCustomer(String username, String password, String firstName, String lastName, Date birthDate,
			String address, String phoneNumber, String emailaddress) {
		this.username = username;
		this.password = password;
		this.firstName = firstName;
		this.lastName = lastName;
		this.birthDate = birthDate;
		this.address = address;
		this.phoneNumber = phoneNumber;
		this.emailaddress = emailaddress;
	}

	@Override
	public String getFirstName() {
		return firstName;
	}

	@Override
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	@Override
	public String getLastName() {
		return lastName;
	}

	@Override
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (getId() != null ? getId().hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are
		// not set
		if (!(object instanceof Customer)) {
			return false;
		}
		WebCustomer other = (WebCustomer) object;
		if ((this.getId() == null && other.getId() != null)
				|| (this.getId() != null && !this.getId()
						.equals(other.getId()))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "entity.Party[" + " id=" + getId() + ", firstName="
				+ firstName + ", lastName=" + lastName + ", birthDate="
				+ birthDate + ", address=" + address + ", phoneNumber="
				+ phoneNumber + ", emailaddress=" + emailaddress
				 + " ]";
	}

	@Override
	public String getEmailadress() {
		return emailaddress;
	}

	@Override
	public void setEmailadress(String emailadress) {
		this.emailaddress = emailadress;
	}

	@Override
	public String getAddress() {
		return address;
	}

	@Override
	public void setAddress(String address) {
		this.address = address;
	}

	@Override
	public String getPhoneNumber() {
		return phoneNumber;
	}

	@Override
	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	@Override
	public String getUsername() {
		return username;
	}

	@Override
	public String getPassword() {
		return password;
	}

	@Override
	public boolean getLoggedIn() {
		return loggedIn;
	}

	@Override
	public void setLoggedIn(boolean logged) {
		loggedIn = logged;		
	}

	@Override
	public void setUsername(String username) {
		this.username = username;
	}

	@Override
	public void setPassword(String password) {
		this.password = password;
	}

}
